package com.gettagger.tagger.activities;

import com.gettagger.tagger.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;

public class ActSplash extends Activity {

	protected boolean _active = true;
	protected static final int _splashTime = 3000;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE); 
		setContentView(R.layout.act_splash);
		
		// thread for displaying the SplashScreen
        Thread splashTread = new Thread() {
            @Override
            public void run() {
                try {
                    int waited = 0;
                    while(_active && (waited < _splashTime)) {
                        sleep(100);
                        if(_active) {
                            waited += 100;
                        }
                    }
                } catch(InterruptedException e) {
                   
                } finally {
                    finish();
                    startActivity(new Intent(ActSplash.this,ActLogin.class));
                }
            }
        };
        splashTread.start();
	}

}
